<?php

include '../DB/dbConnection.php';

$result=array();

if ($_POST){
	$id=0;
	$datetime=date("Y-m-d H:i:s");
	
	$stmt = $conn->prepare("INSERT INTO achivment (id,achivment,student_id,school_id,datetime) VALUES (?, ?, ?, ?, ?)");
	$stmt->bind_param("isiis",$id,$_POST['achivment'],$_POST['student_id'],$_POST['school_id'],$datetime);
	$success = $stmt->execute();
	$stmt->close();
	$conn->close();
	
	if($success)
		$result['error']='false';
	else
		$result['error']='true';
}
else
{
	$result['error']='true';
}

echo json_encode($result);
?> 
